package ar.edu.uade.fain.ad.test.server;

import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;

import ar.edu.uade.fain.ad.test.server.controller.SistemaServiceBean;
import ar.edu.uade.fain.ad.test.server.dao.hibernate.HibernateUtil;

public class Server {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			HibernateUtil.get();
			final SistemaServiceBean service = new SistemaServiceBean();
			LocateRegistry.createRegistry(1099);
			Naming.rebind("//localhost:1099/sistema", service);
			System.out.println("Hecho.");
		} catch (Exception e) {
			System.err.println("Falla al exponer el servicio: " + e.getMessage());
			e.printStackTrace(System.err);
		}
	}

}
